<?php
namespace Album\Form;

use Zend\Form\Form;

class AlbumForm extends Form
{
    public function __construct($name = null)
    {
        // we want to ignore the name passed
        parent::__construct('album');
        $this->setAttribute('method', 'post');
        $this->add(array(
            'name' => 'id',
            'attributes' => array(
                'type'  => 'hidden',
                 'required'=>true

            ),
        ));

        $this->add(array(
            'name' => 'artist',
            'attributes' => array(
             'type'  => 'text',
              'required'=>true
            ),
            'options' => array(
                'label' => 'Artist',

            ),
        ));

        $this->add(array(
            'name' => 'title',
            'attributes' => array(
             'type'  => 'text',
            'required'=>true
            ),
            'options' => array(
                'label' => 'Title',
            ),
        ));

  $this->add(array(
            'type' => 'Zend\Form\Element\Select',
            'name' => 'category_id',

            'options' => array(
                'label' => 'Category',

                'value_options' => array(
                    '1' => '-SELECT-',

                ),
            ),
            'attributes' => array(
             //   'value' => '1', //set selected to '1'
            //    'required'=>true,
                'id' => 'cat_sel_id',
            )
        ));


        $this->add(array(
            'name' => 'submit',
            'attributes' => array(
                'type'  => 'submit',
                'value' => 'Go',
                'id' => 'submitbutton',
                'class'=>'btn-primary btn-large'
            ),
        ));
    }
}
